<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>个人</title>
</head>
<div th:fragment="head" id="app">
    <div>
        <el-menu
                class="el-menu-demo"
                mode="horizontal"
                background-color="#545c64"
                text-color="#fff"
                active-text-color="#ffd04b"
                style="width: 100%;">

            <el-menu-item index="1" style="min-width: 130px">
                个人中心
            </el-menu-item>

            <div>
                <!--登录后-->
                <div th:if="${session.SPRING_SECURITY_CONTEXT}!=null" style="display: flex;justify-content: space-evenly;">
                    <el-menu-item index="2" style="min-width: 130px">
                        <a href="/api/public/home" style="display: inline-block;
                        height: 100%;;text-decoration:none;width: 120px;color: papayawhip">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首页
                        </a>
                    </el-menu-item>

                    <el-menu-item index="3" style="min-width: 130px" >
                        <el-avatar  size="small" th:src="@{'/api/public/showImg/'+
                        ${session.SPRING_SECURITY_CONTEXT.authentication.principal.img}}"></el-avatar>
                        用户登录: <span th:text="${session.SPRING_SECURITY_CONTEXT.authentication.principal.nickname}" style="color: red"></span>
                    </el-menu-item>

                    <el-menu-item index="4" style="width: 100px">
                        <a href="/logout" style="text-decoration:none;color:#FFFFFF;">
                            <el-tag  type="info" >退出</el-tag>
                        </a>
                    </el-menu-item>
                </div>
            </div>
        </el-menu>
    </div>
</div>

<script>
    new Vue({
        el: "#app",
        data:{
        },
        methods:{
        },
        mounted: function(){
        }
    })

</script>
<style>

</style>
</html>